package com.zyj.token.service.impl;

import java.util.List;

import com.zyj.common.core.text.Convert;
import com.zyj.token.domain.AssetsLoginToken;
import com.zyj.token.mapper.AssetsLoginTokenMapper;
import com.zyj.token.service.IAssetsLoginTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * tokenService业务层处理
 * 
 * @author zhuyujie
 * @date 2022-05-21
 */
@Service
public class AssetsLoginTokenServiceImpl implements IAssetsLoginTokenService
{
    @Autowired
    private AssetsLoginTokenMapper assetsLoginTokenMapper;

    /**
     * 查询token
     * 
     * @param token token主键
     * @return token
     */
    @Override
    public AssetsLoginToken selectAssetsLoginTokenByToken(String token)
    {
        return assetsLoginTokenMapper.selectAssetsLoginTokenByToken(token);
    }

    /**
     * 查询token列表
     * 
     * @param assetsLoginToken token
     * @return token
     */
    @Override
    public List<AssetsLoginToken> selectAssetsLoginTokenList(AssetsLoginToken assetsLoginToken)
    {
        return assetsLoginTokenMapper.selectAssetsLoginTokenList(assetsLoginToken);
    }

    /**
     * 新增token
     * 
     * @param assetsLoginToken token
     * @return 结果
     */
    @Override
    public int insertAssetsLoginToken(AssetsLoginToken assetsLoginToken)
    {
        return assetsLoginTokenMapper.insertAssetsLoginToken(assetsLoginToken);
    }

    /**
     * 修改token
     * 
     * @param assetsLoginToken token
     * @return 结果
     */
    @Override
    public int updateAssetsLoginToken(AssetsLoginToken assetsLoginToken)
    {
        return assetsLoginTokenMapper.updateAssetsLoginToken(assetsLoginToken);
    }

    /**
     * 批量删除token
     * 
     * @param tokens 需要删除的token主键
     * @return 结果
     */
    @Override
    public int deleteAssetsLoginTokenByTokens(String tokens)
    {
        return assetsLoginTokenMapper.deleteAssetsLoginTokenByTokens(Convert.toStrArray(tokens));
    }

    /**
     * 删除token信息
     * 
     * @param token token主键
     * @return 结果
     */
    @Override
    public int deleteAssetsLoginTokenByToken(String token)
    {
        return assetsLoginTokenMapper.deleteAssetsLoginTokenByToken(token);
    }
}
